// 9.6 
class FindElemFromMatrix{
	boolean FindElem(int[][] mat, int elem, int m, int n){
		int row = 0;
		int col = n - 1;
		
		while(row < m && col >= 0){
			if(mat[row][col] == elem){
				return true;
			} else if(mat[row][col] > elem){
				--col;
			} else {
				row++;
			}
		}
		return false; 	
	}
}